<?php

class DBMQueryRequest {
	/**
	 * The fields of the query
	 *
	 * @var array<string>
	 */
	private $fields = array();
	
	/**
	 * The query string
	 *
	 * @var string
	 */
	private $queryString = null;
	
	/**
	 * Return the query string
	 *
	 * @return string The query
	 */
	public function getQueryString(){
		return $this->queryString;
	}
	
	/**
	 * Set the query string
	 *
	 * @param string $queryString
	 */
	public function setQueryString($queryString){
		$this->queryString = $queryString;
	}
	
	/**
	 * Return the fields of the query
	 *
	 * @return array<string>
	 */
	public function getFields(){
		return $this->fields;
	}
	
	/**
	 * Set the fields of the query
	 *
	 * @param array<string> $fields
	 */
	public function setFields($fields){
		$this->fields = $fields;
	}
	
	/**
	 * Add a new field to the query
	 *
	 * @param string $field
	 */
	public function addField($field){
		if(is_string($field)){
			$this->fields[] = $field;	
		} elseif(is_object($field)){
			$this->fields[] = $field->__toString();
		} else {
			throw new IllegalArgumentException("string", gettype($field));
		}
	}
}

?>
